/*
 * MenuItem.cpp
 *
 *  Created on: 2011-03-30
 *      Author: tmacyszyn
 */

#include "Menu/MenuItem.h"

#include <Vertex\MenuItem.v>

float MenuItem::gap = MENU_ITEM_GAP;
float MenuItem::width = MENU_ITEM_WIDTH;
float MenuItem::height = MENU_ITEM_HEIGHT;

MenuItem::~MenuItem()
{

}

void
MenuItem::Render(float parentX, float parentY)
{
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	glTranslatef(posX + parentX, posY + parentY, 0);

	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, textsTexture);
	glColor4f(0.5f, 1.0f, 1.0f, 1.0f);
	glVertexPointer(2, GL_FLOAT, 0, points);
	glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}

void
MenuItem::CleanUp()
{
	glDeleteTextures(1, &textsTexture);
}
